package com.qk.management.mapper;

import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ZLJ
 * @date 2025/10/7 18:16
 * @Description
 */
@Mapper
@SuppressWarnings("all")
public interface UserMapper {

    @Select("select * from user where id= #{userId}")
    User selectById(Integer userId);

    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);

    @Select("select * from user where dept_id=#{deptId}")
    List<UserDO> getByDept(Integer deptId);
    //@Select("select * from role where label = #{roleLabel}")

    List<UserDO> listByRole(String roleLabel);

    @Select("select * from user")
    List<UserDO> selectAll();

    /*@Delete("delete from user where id=#{id}")
    void deleteById(Integer id);*/

    void update(User user);

    UserDO getById(Integer id);

    void insert(User user);

    List<UserDO> selectByPage(UserDTO dto);

    void deleteBatch(List<Integer> ids);
}
